﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Services.StartServices;
using IntelligentAgriculture.WebAPI.Application.Command.BreedingInfoCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.BreedingInfoCommandHandler
{
    /// <summary>
    /// 种母配种
    /// </summary>
    public class DelBreedingInfoCommandHandler : IRequestHandler<DelBreedingInfoCommand, Results<int>>
    {


        private readonly IBreedingInfoService _service;
        public DelBreedingInfoCommandHandler(IBreedingInfoService service)
        {
            _service = service;
        }

        public async Task<Results<int>> Handle(DelBreedingInfoCommand request, CancellationToken cancellationToken)
        {
            var list = await _service.DeleteBreedingInfo(request.BreedId);
            return Results<int>.DataResult(list);
        }
    }
}
